{$CLEO .cs}
{$use cleo+}
0000:

model.Load(#BIKDRUG) 
model.Load(#SAWNOFF) 
038B: load_requested_models


const

Found_target =   19@
end
Found_target = false 
while $onmission >= 1   
wait 0      
    if  00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere -2443.6743 749.4667 35.1719 radius 100.0 100.0 100.0
    then
 
            if not marker_enabled 1@
            then
               1@ = marker.CreateIconWithoutSphere(37, -2443.6743, 749.4667, 35.1719)
            end
            if   and
              02A0:   actor $PLAYER_ACTOR stopped
              00FE:   actor $PLAYER_ACTOR sphere 1 in_sphere -2443.6743 749.4667 35.1719 radius 4.0 4.0 4.0
            then
                 goto @Target
            end

             wait 100   
          
    else 
            if  marker_enabled 1@
            then
                marker.Disable(1@ )
            end        
            if  marker_enabled 2@
            then
                marker.Disable(2@ )
            end        
        wait 100
    end 
    
 
end 

:Target
show_styled_text "~w~Look for the target" 4000 5
  add_text_label "@hitman" "The biker wants to see you driving a motorcycle, then he appears somewhere!"
0512: show_permanent_text_box '@hitman'  // If your health reaches zero, you will pass out and you will be treated at the local medical center.

while $onmission >= 1 
wait 0
0208: 13@ = random_float_in_ranges 180.0 350.0
0208: 14@ = random_float_in_ranges 180.0 350.0

04C4: store_coords_to 20@ 21@ 22@ from_actor $PLAYER_ACTOR with_offset 13@ 14@ 0.0
02C0: store_to  23@ 24@ 25@ ped_path_coords_closest_to  20@ 21@ 22@

      if 047A:   actor player1 driving_bike
      then
          Found_target = true 
      end
      if coop
      then
          if 047A:   actor player2 driving_bike

          then
             Found_target = true 
          end      
      end
      if  and 
      not is_actor_defined  0@
      Found_target == true  
      then
          0@ = actor.Create(gang5, #BIKDRUG , 23@, 24@, 25@ )
          actor.Health(0@)= 2000
          actor.GiveWeaponAndAmmo(0@,sawnoff,88888)
          actor.WeaponAccuracy(0@)=70
          0446: set_actor 0@ dismemberment_possible 0
          07DD: set_actor 0@ attack_rate 70 // previously known as temper_to
          0946: set_actor 0@ actions_uninterupted_by_weapon_fire 1
          077A: set_actor 0@ acquaintance 4 to_actors_pedtype 0 // see ped.dat
          077A: set_actor 0@ acquaintance 4 to_actors_pedtype 1 // see ped.dat
          077A: set_actor 0@ acquaintance 4 to_actors_pedtype 6 // see ped.dat
          07FE: set_actor 0@ fighting_style_to 7 moves 6
          05DE: AS_actor 0@ walk_around_ped_path
          marker.CreateAboveActor(2@,0@)
          show_styled_text "~r~Target location revealed!~N~~r~Kill the target!" 4000 5
          03E6: remove_text_box

      end
      if is_actor_defined   0@
      then
          if actor.Dead(0@)
          then
              show_styled_text "~y~Target eliminated!~n~~b~Reward~n~~w~$2500" 4000 5
              0109: player $PLAYER_CHAR money += 2500
              018C: play_sound 1052 at 0.0 0.0 0.0
              $HITMAN_DESTROYED += 1 
              $HITMAN_DESTROYED_SF += 1 
              break
          end
      
      end 
end
03E6: remove_text_box
//Cleanup 
if is_actor_defined  0@
then
    actor.RemoveReferences( 0@ )
end 
if  marker_enabled 1@
then
marker.Disable(1@ )
end        
if  marker_enabled 2@
then
marker.Disable(2@ )
end             
model.destroy(#BIKDRUG) 
model.destroy(#SAWNOFF) 

terminate_this_custom_script